import torch
import torch.nn as nn


# 定义一个简单的卷积神经网络模型
class SimpleCNN(nn.Module):
    def __init__(self):
        super(SimpleCNN, self).__init__()
        self.conv1 = nn.Conv2d(3, 16, kernel_size=3)
        self.bn1 = nn.BatchNorm2d(16)
        self.relu = nn.ReLU()

    def forward(self, x):
        x = self.conv1(x)
        x = self.bn1(x)
        x = self.relu(x)
        return x


# 创建模型实例
model = SimpleCNN()

# 使用模型进行前向传播
input_data = torch.randn(1, 3, 32, 32)  # 输入数据格式为(batch_size, channels, height, width)
output = model(input_data)
print(output)
print(output.shape)
